package com.wanbangee.marksystem.service.imp;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.wanbangee.marksystem.dao.MAnswerSheetRecordDao;
import com.wanbangee.marksystem.dao.MStudentAnswerSheetDao;
import com.wanbangee.marksystem.dao.MStudentDao;
import com.wanbangee.marksystem.dao.MSubjectDao;
import com.wanbangee.marksystem.entities.MStudent;
import com.wanbangee.marksystem.entities.MSubject;
import com.wanbangee.marksystem.entities.StatisticsScoreReport;
import com.wanbangee.marksystem.entities.UClass;
import com.wanbangee.marksystem.service.ExamListService;
import com.wanbangee.marksystem.service.ScoreService;
import com.wanbangee.marksystem.service.UserCenterService;

@Service
public class ExamListServiceImp implements ExamListService {

	@Autowired
	private MStudentAnswerSheetDao mStudentAnswerSheetDao; 
	@Autowired
	private MAnswerSheetRecordDao mAnswerSheetRecordDao;
	@Autowired 
	private ScoreService scoreService;
	@Autowired
	private MStudentDao mStudentDao;
	@Autowired
	private MSubjectDao mSubjectDao;
	@Autowired
	private UserCenterService userCenterService;
	
	@Transactional
	@Override
	public Map<String, Object> endExamBySubId(Integer examId, Integer examSubId) {
	
		
		//1.查询当前科目是否有异常卷
		Integer selException = mStudentAnswerSheetDao.selException(examId, examSubId);
		//2.查询当前科目是否有未处理的问题卷
		Integer selQuestion = mAnswerSheetRecordDao.selQuestion(examId, examSubId);
		//3. 查询当前科目是否有未完成的阅卷任务
		//3.1 查询未完成的单评任务
		//3.2查询未完成的多评任务
		//3.3查询未完成的重评任务
		//3.4查询未完成的仲裁任务
		List<Integer> selExamTask = scoreService.selExamTask(examId, examSubId);
		
		
//			初始化该科目的科目成绩单
		
		
	
//			 初始化考试成绩单
//			查询该场考试是否有已经结束的科目
//			有则修改科目成绩单
//			没有则插入科目成绩单
		
	


	

	
	


//		
//			 初始化平均分排名表
		
		
		

////		初始化客观题得分表
//		
////		初始化主观题得分表
		
		
		
		return null;
	}

}
